package cn.xiaopengstack.domain.order.repository;

import cn.xiaopengstack.domain.order.model.aggregate.CreateOrderAggregate;
import cn.xiaopengstack.domain.order.model.entity.OrderEntity;
import cn.xiaopengstack.domain.order.model.entity.PayOrderEntity;
import cn.xiaopengstack.domain.order.model.entity.ShopCarEntity;
import cn.xiaopengstack.types.event.BaseEvent;

/**
 * @author jiangyangang
 */
public interface IOrderRepository {

    /**
     * 保存订单
     * @param createOrderAggregate
     */
    void createOrder(CreateOrderAggregate createOrderAggregate);

    /**
     * 查询未支付的订单
     * @param shopCarEntity
     * @return
     */
    OrderEntity queryUnPayOrder(ShopCarEntity shopCarEntity);


    /**
     * 查询订单
     * @param orderId
     * @return
     */
    OrderEntity queryPayOrder(String orderId);

    /**
     * 更新订单状态
     * @param payOrderEntity
     */
    void updatePayOrder(PayOrderEntity payOrderEntity);

    /***
     * 发送订单支付结果通知
     * @param event
     */
    void sendOrderPayResultMsg(BaseEvent<?> event);
}
